#ifndef __NETFD_LIST__
#define __NETFD_LIST__

typedef struct node_s {
    int val;
    struct node_s *next;
} node_t;

typedef struct list_s {
    node_t *head;
    node_t *tail;
    int size;
} list_t;

list_t *create_list();
void destroy_list(list_t *list);
void add_before_head(list_t *list, int val);
void add_behind_tail(list_t *list, int val);
void add_node(list_t *list, int idx, int val);
void delete_node(list_t *list, int val);
node_t *find_by_index(list_t *list, int idx);
node_t *search_for_value(list_t *list, int val);

#endif
